//
//  leftMoreViewController.m
//  ioschishan
//
//  Created by 千翼网络科技 on 2017/7/27.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "leftMoreViewController.h"
#import "topTableViewCell.h"
#import "walletViewController.h"
#import "helpViewController.h"
#import "teacherViewController.h"
#import "messageViewController.h"
#import "setupViewController.h"
#import "myCollectionViewController.h"
#import "myfoucsViewController.h"

@interface leftMoreViewController ()

@end

@implementation leftMoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initView];
}

#pragma mark ------------------ requestData -------------------



#pragma mark ------------------ init -------------------

- (void)initView{
    
    self.title = @"更多";
    
    titleArray = @[@"我的钱包",@"我的帮助",@"认证教师",@"设置",@"我的关注",@"我的收藏"];
    imgArray = @[@"wallet_icon",@"my_help_icon",@"authentication_icon",@"setting_icon",@"guanzhu",@"qzone"];
    
    _pianoListTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, scrWidth(), scrHeight() - 64)];
    _pianoListTableView.backgroundColor = getColor(@"f3f5f7");
    _pianoListTableView.delegate = self;
    _pianoListTableView.dataSource = self;
    _pianoListTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_pianoListTableView];
    
    UIView *threadView = [[UIView alloc]initWithFrame:CGRectMake(0, screenScale(1), scrWidth(), screenScale(0.7))];
    threadView.backgroundColor = getColor(@"cccccc");
    [self.view addSubview:threadView];
}

#pragma mark ------------------ click -------------------

- (void)searchBtnClick{
    
    NSLog(@"搜索");
    
//    searchViewController *searchVC = [[searchViewController alloc]init];
//    [self.navigationController pushViewController:searchVC animated:YES];
}

#pragma mark -------------------- tableView ----------------------

#pragma mark --- UITableViewDelegate ---

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return screenScale(50);
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        
        walletViewController *vc = [[walletViewController alloc]init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }else if (indexPath.row == 1){
        
        helpViewController *vc = [[helpViewController alloc]init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }else if (indexPath.row == 2){
        
        teacherViewController *vc = [[teacherViewController alloc]init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }else if (indexPath.row == 3){
        
        setupViewController *vc = [[setupViewController alloc]init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }else if (indexPath.row == 4){
        
        myfoucsViewController *vc = [[myfoucsViewController alloc]init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }else if (indexPath.row == 5){
        
        myCollectionViewController *vc = [[myCollectionViewController alloc]init];
        vc.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:vc animated:YES];
        
    }
    
}

#pragma mark --- UITableViewDataSource ---

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 6;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView registerClass:[topTableViewCell class] forCellReuseIdentifier:@"topTableViewCell"];
    topTableViewCell *cell = (topTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"topTableViewCell" forIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    cell.leftImg.image = [UIImage imageNamed:imgArray[indexPath.row]];
    cell.nameLable.text = titleArray[indexPath.row];
    
    
    return cell;
}

@end
